<!--
 * @Author: 你的名字
 * @Date: 2022-09-21 15:00:51
 * @FilePath: /demo-gather/src/App.vue
 * @Description: 
-->
<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  components: {},
  data() {
    return {
      xmlData:
        '<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas"> <cas:authenticationSuccess> <!-- 认证凭证--> <cas:user>username</cas:user> <!—登录用户信息，具体见附件 A1 --> <cas:attributes> <cas: IDCARD_UUID>dsfsdfsd</cas: IDCARD_UUID> <cas: USER_NAME >张三</cas: USER_NAME> </cas:attributes></cas:authenticationSuccess> </cas:serviceResponse>',
    };
  },
  mounted() {
    this.getUid();
  },
  methods: {
    getUid() {
      // var reg = /(<\/?font.*?>)|(<\/? cas: IDCARD_UUID.*?>)|(<\/?a.*?>)/gi;
      // var reg = /(<\/? font.*?>)|(<\/? cas: IDCARD_UUID>)|(<\/? a.*?>)/gi
      // var reg = /(<\/?font.*?>)|(<\/? cas: IDCARD_UUID>)|(<cas: IDCARD_UUID>)|(<\/?a.*?>)/gi

      // var reg = /(<\/? cas:IDCARD_UUID.*?>)/gi
      let c = this.xmlData.split('<cas: IDCARD_UUID>');
      c=c[1].split('</cas: IDCARD_UUID>')
      var reg4= /(<\/?font.*?>)|(<\/?span.*?>)|(<\/?a.*?>)/gi;

      console.log(c);
      var str =
        '<span>我是被保留的</span><a href="asdasd">你好，我也是被保留的<font>我的font里的</font></a>';
      console.log(str.replace(reg4, ""));
    },
  },
};
</script>

<style>
html{
  height: 100%;
  box-sizing: border-box;
}
body {
  width: 100%;
  height: 100%;
  margin: 0;
}
#app {
  width: 100%;
  height: 100%;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  background: #000;
}
*{
  font-size: .12rem;
}
ul,li{ padding:0;margin:0;list-style:none}
</style>
 